/**
 * @Author: lt
 * @Date: 2019/8/27
 * @Last Modified by:   lt
 * @Last Modified time: 2019-08-27 15:45:00
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 预约限量查询
export const getBookingLimit = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/reservationLimit`, { params });

// 时间间隔查询
export const getBookingLimitMins = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/reservationLimit/mins`, { params });

// 根据id查询预约限量
export const getBookingLimitById = id => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/reservationLimit/${id}`);

// 修改预约限量
export const updateBookingLimit = (mins, params) => axios.put(`${SERVER.DMSCLOUD_REPAIR}/basedata/reservationLimit/initBookingLimit/${mins}`, params);

// 新增预约限量
export const addBookingLimit = params => axios.put(`${SERVER.DMSCLOUD_REPAIR}/basedata/reservationLimit`, params);

// 预约类型查询
export const getBookingType = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/reservationLimit/type`, { params });

// new
// 更新预约限量时间设置
export const updateTimeInterval = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/precontractStatus/updatePrecontractLimitPara`, params);

// 保存预约限量
export const saveBookingLimitList = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/precontractStatus/savePrecontractLimit`, params);

// 导出导入模板接口
export const exportTemplate = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/precontractStatus/exportPrecontractLimit`, {
    params,
    responseType: 'blob'
  });

// 查询预约限量数据
export const queryBookingLimitList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/precontractStatus/queryPrecontractLimit`, {
    params
  });
